package _72

func firstPalindrome(words []string) string {
	for _, word := range words {
		if isPalindrome(word) {
			return word
		}
	}
	return ""
}

func isPalindrome(s string) bool {
	if len(s) == 0 {
		return false
	}
	sb := []byte(s)
	n := len(sb)
	for i := 0; i < n/2; i++ {
		if sb[i] != sb[n-i-1] {
			return false
		}
	}
	return true
}
